package config;

import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

public class ReadSystemConfig {
    @Bean
  public WebMvcConfigurer webMvcConfigurer(){
     return new WebMvcConfigurer(){
          @Override
          public void addViewControllers(ViewControllerRegistry registry) {
//              img文件下的图片
              registry.addViewController("/").setViewName("images/banner1.jpg");
              registry.addViewController("/").setViewName("images/banner2.jpg");
              registry.addViewController("/").setViewName("images/banner3.jpg");
              registry.addViewController("/").setViewName("images/loading.gif");

//tab图片切换
              registry.addViewController("/").setViewName("tab/article.png");
              registry.addViewController("/").setViewName("tab/article-active.png");
              registry.addViewController("/").setViewName("tab/category.png");
              registry.addViewController("/").setViewName("tab/category-active.png");
              registry.addViewController("/").setViewName("tab/index.png");
              registry.addViewController("/").setViewName("tab/index-active.png");
              registry.addViewController("/").setViewName("tab/my.png");
              registry.addViewController("/").setViewName("tab/my-active.png");
              registry.addViewController("/").setViewName("tab/question.png");
              registry.addViewController("/").setViewName("tab/question-active.png");

          }
      };
  }
}
